/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <cstdio>

using namespace std;

int main_1046()
{
    int n,ASay,APlay,BSay,BPlay,AFail=0,BFail=0,sum=0;
    scanf("%d",&n);
    for (int i=0;i<n ;++i )
    {
        scanf("%d%d%d%d",&ASay,&APlay,&BSay,&BPlay);
        sum=ASay+BSay;
        if (sum==APlay&&sum!=BPlay)
        {
            ++BFail;
        }
        else if (sum!=APlay&&sum==BPlay)
        {
            ++AFail;
        }
        else
        {
            continue;
        }
    }
    printf("%d %d\n",AFail,BFail);
	return 0;
}
